import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:prototype/theme/custom_theme.dart';

class VBaseDialog extends StatelessWidget {
  final Widget? content;
  final Widget? title;
  final String? titleText;
  final bool showConfirmBtn;
  final bool showCloseBtn;

  const VBaseDialog({
    Key? key,
    this.content,
    this.title,
    this.titleText,
    this.showConfirmBtn = false,
    this.showCloseBtn = false,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final _theme = CustomTheme.colorSchema;
    const double _radius = 12.0;
    return Container(
      width: 0.9.sw,
      constraints: BoxConstraints(
        minHeight: 200.h,
        maxHeight: 350.h,
      ),
      decoration: BoxDecoration(
        color: _theme.secondary,
        borderRadius: BorderRadius.circular(_radius),
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.stretch,
        children: [
          DecoratedBox(
            decoration: BoxDecoration(
                color: _theme.tertiary,
                borderRadius: const BorderRadius.vertical(
                  top: Radius.circular(_radius),
                )),
            child: SizedBox(
              child: Center(
                child: title ?? Text(titleText ?? ''),
              ),
              height: 40.h,
            ),
          ),
          Expanded(
            child: Padding(
              padding: EdgeInsets.symmetric(horizontal: 8.0.w, vertical: 10.h),
              child: content ?? const SizedBox.shrink(),
            ),
          ),
        ],
      ),
    );
  }
}
